<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //手机 构造函数
    // 品牌, 价格, 颜色
    // 打电话, 发短信
    function Phone(brand, price, color){
      //实例化对象进行初始化
      this.brand = brand;
      this.price = price;
      this.color = color;
    }

    //构造函数的原型对象上声明方法
    Phone.prototype.call = function(){
      console.log('可以打电话..')
    }

    //发送短信
    Phone.prototype.sendMessage = function(){
      console.log('可以发送短信...');
    }

    let onePlus = new Phone('1+',2399,'蓝色');
    console.log(onePlus);

    onePlus.call();


  </script>
</body>
</html>